<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f5f7fa;
        }
        .content-wrapper {
            background: white;
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        .page-header {
            border-bottom: 2px solid #667eea;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
        }
        .btn-primary:hover {
            opacity: 0.9;
        }
        .table thead {
            background-color: #f8f9fa;
        }
    </style>
</head>

<nav th:fragment="navbar" class="navbar navbar-expand-lg navbar-dark" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
    <div class="container-fluid">
        <a class="navbar-brand" href="/index">🌾 智慧农业管理系统</a>
        <div class="navbar-nav ms-auto">
            <span class="navbar-text text-white me-3">
                欢迎，<span th:text="${session.currentUser?.realName}"></span>
            </span>
            <a class="btn btn-outline-light btn-sm" href="/logout">退出登录</a>
        </div>
    </div>
</nav>

<div th:fragment="sidebar" class="col-md-2 d-md-block sidebar" style="min-height: calc(100vh - 56px); background: white; box-shadow: 2px 0 5px rgba(0,0,0,0.1);">
    <div class="position-sticky pt-3">
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link" href="/index">
                    <i class="fas fa-home me-2"></i> 首页
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/user/list">
                    <i class="fas fa-users me-2"></i> 用户管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/field/list">
                    <i class="fas fa-map me-2"></i> 地块管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/crop/list">
                    <i class="fas fa-seedling me-2"></i> 作物管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/material/list">
                    <i class="fas fa-boxes me-2"></i> 农资管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/plan/list">
                    <i class="fas fa-calendar-alt me-2"></i> 种植计划
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/farming/list">
                    <i class="fas fa-tractor me-2"></i> 农事记录
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/monitor/list">
                    <i class="fas fa-chart-line me-2"></i> 生长监测
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/product/list">
                    <i class="fas fa-shopping-basket me-2"></i> 产品库存
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/sales/list">
                    <i class="fas fa-dollar-sign me-2"></i> 销售记录
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/statistics/index">
                    <i class="fas fa-chart-bar me-2"></i> 数据统计
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/news/list">
                    <i class="fas fa-newspaper me-2"></i> 新闻管理
                </a>
            </li>
        </ul>
    </div>
</div>

<div th:fragment="scripts">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
</div>

</html>

